Conversation
Class: TextureMoveTool Method: DoToolUI Snapping is done by using EditorSnapping.MoveSnap on the moved position. There are three handles - Slider2D - Slider1D Up ( Green arrow) - Slider1D Right (RedArrow) The Slider2D has an explicit individual snap value of 0.0f. The Slider1Ds use a method override that internally applies -1.0f as a snap factor. The position done via Slider1D is snapped to 1.0 increments before getting to the MoveSnap line where the acutual snap settings are applied.
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
🤖 Helpful? Please react with 👍/👎 | Questions❓Please reach out in Slack #ask-u-pr-agent |
|
Hi @CortiWins, thanks for your interest in improving ProBuilder. |
|
Hello @thomas-tu it was not an optimization, it was a fix for an issue i had. In the unity version of the code:
So Slider2D returns "unsnapped" position while Slider returns already snapped positions and i had some case where that lead to an issue which i noticed when the 2D Slider worked fine with snapping and the 1D Sliders did not. And so it tried giving the Slide1D gizmos the same treatment the Slider2D already had and that fixed it. Currently, i can not reproduce the bug any more, which means that something is different from what it was in october last year and that bothers me a lot to be honest. Anyways, that is it for now. |
|
Hello @CortiWins, thank you for the clarification. Feel free to open it back or file a Bug Report through the Editor ( |
Purpose of this PR
Class: TextureMoveTool
Method: DoToolUI
Snapping is done by using EditorSnapping.MoveSnap on the moved position.
There are three handles
The Slider2D has an explicit individual snap value of 0.0f. The Slider1Ds use a method override that internally applies -1.0f as a snap factor.
The position done via Slider1D is snapped to 1.0 increments before getting to the MoveSnap line where the actual snap settings are applied.